

import time
from selenium import webdriver
from poium import Page, Element

class Baidu(Page):
    keyword_input = Element(xpath='//*[@id="kw"]')
    search_button = Element(xpath='//*[@id="su"]')


if __name__ == '__main__':
    driver = webdriver.Chrome()
    bd_home = Baidu(driver)
    bd_home.get("https://www.baidu.com/")
    bd_home.keyword_input.send_keys("深圳")
    bd_home.search_button.click()
    time.sleep(3)
    driver.close()
    driver.quit()